<?php

namespace App\HttpController\Admin;

use App\Logic\Purchase\PurchaseService;

/**
 * 订单
 */
class Purchase extends BaseController {
    /**列表*/
    public function index()
    {
        $service = new PurchaseService();
        $result = $service->getLists($this->request());
        return $this->writeJsonByOutput($result);
    }
    /**字典*/
    public function dict()
    {
        $service = new PurchaseService();
        $result = $service->getDict($this->request());
        return $this->writeJsonByOutput($result);
    }
    /**创建订单*/
    public function create()
    {
        $service = new PurchaseService();
        $data = $this->getJson();
        $result = $service->create($data);
        return $this->writeJsonByOutput($result);
    }
    /**编辑订单*/
    public function edit()
    {
        $service = new PurchaseService();
        $data = $this->getJson();
        $result = $service->edit($data);
        return $this->writeJsonByOutput($result);
    }

}
